package com.health.controller.manage;


import com.health.common.R;
import com.health.pojo.User;
import com.health.service.UserService;
import com.health.vo.UserLoginVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/manage/user")
@Api(tags = "用户管理")
@RequiredArgsConstructor
@Slf4j
public class UserController {

    private final UserService userService;

    @ApiOperation(value = "用户登录")
    @PostMapping("login")
    public R login(@RequestBody User user) {
        UserLoginVO loginVO = userService.login(user);
        return R.success(loginVO);
    }


}
